<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="dialog.js">
</script>
<script type="text/javascript" src="../template/template.js">
</script>
<script type="text/javascript">
    document.write("<link href='../language/" + lang.ax + ".css' type='text/css' rel='stylesheet'>");
    document.write("<link href='../skin/" + config.Skin + "/dialog.css' type='text/css' rel='stylesheet'>");
    var Q = lang["DlgTemplate"];
    document.write("<title>" + Q + "</title>");
    function ok() {
        var K = $("iframe_preview").contentWindow.document.body.getElementsByTagName("IMG");
        var l = K.length;
        for (var i = 0; i < l; i++) {
            var s = K[i].getAttribute("src", 2);
            if ((s.substring(0, 1) != "/") && (s.indexOf("://") == -1)) {
                if (s.substring(0, 3) == "../") {
                    s = s.substr(3);
                } else {
                    s = "template/" + s;
                }
                s = fH(s);
            }
            K[i].setAttribute("eWebEditor_Temp_Img_Url", s);
        }
        var html = $("iframe_preview").contentWindow.document.body.innerHTML;
        if (nT == "replace") {
            EWIN.setHTML(html, true);
        } else {
            EWIN.insertHTML(html);
        }
        if (l > 0) {
            var hX = A.F.getElementsByTagName("IMG");
            for (var i = 0; i < hX.length; i++) {
                var url = hX[i].getAttribute("eWebEditor_Temp_Img_Url", 2);
                if (url) {
                    hX[i].src = url;
                    hX[i].removeAttribute("eWebEditor_Temp_Img_Url");
                }
            }
        }
        parent.aT();
    };
    function ah() {
        lang.TranslatePage(document);
        we();
        rN(0);
        parent.bp(Q);
    };
    function we() {
        var html = "";
        for (var i = 0; i < config.Template.length; i++) {
            html += "<div id='item_" + i + "' class='item' onclick='rN(" + i + ")'>" + config.Template[i][2] + "</div>";
        }
        $("divOption").innerHTML = html;
    };
    var nx = -1;
    function rN(n) {
        if (nx == n) {
            return;
        }
        var t;
        if (nx != -1) {
            t = document.getElementById("item_" + nx);
            t.className = "item";
        }
        t = document.getElementById("item_" + n);
        t.className = "itemselected";
        $("iframe_preview").contentWindow.location.replace("../template/" + config.Template[n][1]);
        nx = n;
    };
    function wZ() {
        try {
            if (O.ae) {
                $("iframe_preview").contentWindow.document.body.runtimeStyle.zoom = "50%";
            } else {}
        } catch(e) {}
    };
    var nT = "insert";
    function rJ(an) {
        if (nT == an) {
            return;
        }
        if (an == "insert") {
            $("d_pos_insert").checked = true;
            $("d_pos_replace").checked = false;
        } else {
            $("d_pos_insert").checked = false;
            $("d_pos_replace").checked = true;
        }
        nT = an;
    }
</script>
<style>
.item {
	padding:0px 0px 0px 5px;
	margin:0px;
	WHITE-SPACE:nowrap;
	color:#000000;
	background-color:#ffffff
}
.itemselected {
	padding:0px 0px 0px 5px;
	margin:0px;
	WHITE-SPACE:nowrap;
	color:#ffffff;
	background-color:#0A246A
}
</style>
</head>
<body onLoad="ah()">
<table border=0 cellpadding=0 cellspacing=5 id=tabDialogSize>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=0 width="100%" align=center>
  <tr>
    <td><table border=0 cellpadding=0 cellspacing=0 align=center>
        <tr>
          <td><span lang="DlgTemplateOption"></span>:</td>
          <td></td>
          <td><span lang="DlgTemplatePreview"></span>:</td>
        </tr>
        <tr>
          <td valign=top nowrap><div id=divOption style="BORDER-RIGHT:1.5pt inset;PADDING-RIGHT:0px;BORDER-TOP:1.5pt inset;PADDING-LEFT:0px;PADDING-BOTTOM:0px;OVERFLOW:auto;BORDER-LEFT:1.5pt inset;WIDTH:150px;PADDING-TOP:0px;BORDER-BOTTOM:1.5pt inset;HEIGHT:310px;BACKGROUND-COLOR:white"> </div></td>
          <td width=10>&nbsp;</td>
          <td valign=top><div id=divPreview style="BORDER:1.5pt inset;PADDING:0px;VERTICAL-ALIGN:top;OVERFLOW:hidden;WIDTH:410px;HEIGHT:310px;BACKGROUND-COLOR:white">
              <iframe id=iframe_preview src="blank.htm" width="100%" height="100%" onload="wZ()" frameborder=0 scrolling="auto"></iframe>
            </div></td>
        </tr>
        <tr>
          <td colspan=3><input type=radio checked id=d_pos_insert onClick="rJ('insert')">
            <label for=d_pos_insert><span lang=DlgComInsertCursor></span></label>
            &nbsp;
            <input type=radio id=d_pos_replace onClick="rJ('replace')">
            <label for=d_pos_replace><span lang=DlgComInsertReplace></span></label></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height=5></td>
  </tr>
  <tr>
    <td nowrap align=right><input type=submit class="dlgBtnCommon dlgBtn" value='' id="btn_ok" onClick="ok()" lang=DlgBtnOK>
      &nbsp;&nbsp;
      <input type=button class="dlgBtnCommon dlgBtn" value='' onClick="parent.aP()" lang=DlgBtnCancel></td>
  </tr>
    </td>
    </tr>
</table>
</body>
</html>